﻿@{
}
<section class="container-fluid m15_t">
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
                <div class="input-group input-group-sm">
                    <div class="input-sm"><input name="autoRefresh" type="checkbox" title="10秒自动刷新" /> <label id="time" class="wd125 gettext">10秒自动刷新</label></div>
                </div>
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">名称：</label>
                        <input class="form-control" name="name" type="text" autocomplete="off">
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
        <div class="paging">
        </div>
    </div>
</section>
@section footerScript{
    <script type="text/javascript">
        var autoRefresh = $("input[name='autoRefresh']");

        $(function () {
            FlashPay.UI.DataAutoHeight();

            doSearch();

            $("#btnSearch").click(function () {
                doSearch();
            });

            $(autoRefresh).change(function () {
                wait = 10;
                time();
            });
        });

        //倒时计
        function time() {

            var language = FlashPay.Util.Language();

            var obj = document.getElementById("time");

            var isauto = $(autoRefresh).is(':checked');
            if (!isauto) {

                obj.innerText = "10 秒自动刷新";

                return false;
            }

            if (wait == 0) {
                obj.innerText = "10秒自动刷新";

                wait = 10;

                if (isauto) {
                    setTimeout(function () { time(); }, 1000);
                }

                FlashPay.UI.DoSearch();
            } else {
                obj.innerText = wait + "秒自动刷新";
                wait--;
                setTimeout(function () { time(); }, 1000);
            }
        }

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {
            FlashPay.UI.Pager(".paging", { ajax: { url: '@Url.Action("BankCardQuery", "Auth")' } });
        }
    </script>
}


